import request from '@/utils/request'

const basePath = '/system/menu'

export const GetAllData = () => {
	return request({
		url: `${basePath}/all`,
		method: 'get',
	})
}

export const AddData = data => {
	return request({
		url: `${basePath}/add`,
		method: 'post',
		data,
	})
}

export const ModifyData = data => {
	return request({
		url: `${basePath}/modify`,
		method: 'post',
		data,
	})
}

export const DeleteData = data => {
	return request({
		url: `${basePath}/delete`,
		method: 'post',
		data,
	})
}

export const GetAssignedMenus = roleId => {
	return request({
		url: `${basePath}/assigned/${roleId}`,
		method: 'get',
	})
}

export const AssignMenus = data => {
	return request({
		url: `${basePath}/assign`,
		method: 'post',
		data,
	})
}